<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <%@include file="/common/common.jspf"%>
    <script type="text/javascript" src="${ctx}/js/qc/nc/nc_add.js">

    </script>
    <style type="text/css">
        .col-sm-3 {
            width: 15%;
            float: left;
        }

        .col-sm-9 {
            width: 85%;
            float: left;
        }

        label[class^="btn btn-default"] {
            margin-top: -4px;
        }
    </style>
</head>
<body>
<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
<form id="form" name="form" class="form-horizontal" method="post"
      action="${ctx}/devicecheck/check_addEntity.shtml">
    <input type="hidden" value="${id}" name="deviceCheckFormMap.deviceCheckId" id="deviceCheckId">
    <section class="panel panel-default">
        <div class="panel-body">
            <div class="form-group">
                <label class="col-sm-3 control-label">设备名称</label>
                <div class="col-sm-9">
                    <select class="form-control" name="deviceCheckFormMap.deviceName" id="deviceName" >
                        <option value="0">--请选择--</option>
                        <c:forEach items="${devType}" var="type">
                            <option value="${type.deviceTypeId}">${type.deviceTypeName}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">检验工时</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control checkabh" name="deviceCheckFormMap.devicecheckWorkinghours" id="devicecheckWorkinghours">
                </div>
            </div>
            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-3 control-label">检验类型</label>
                <div class="col-sm-9">
                    <select class="form-control" name="deviceCheckFormMap.deviceCheckType" id="deviceCheckType" >
                        <option value="1">巡检项目</option>
                        <option value="2">润滑项目</option>
                        <option value="3">点检项目</option>
                    </select>
                </div>
            </div>

            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-3 control-label">操作员</label>
                <div class="col-sm-9">
                    <select class="form-control" name="deviceCheckFormMap.deviceCheckEmp" id="deviceCheckEmp" >
                        <option value="0">--请选择--</option>
                        <c:forEach items="${emp}" var="emps">
                            <option value="${emps.empId}">${emps.empName}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>



            <div class="line line-dashed line-lg pull-in"></div>
            <!-- 开始处理清单 -->
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">产品名称</h3>
                </div>
                <div class="panel-body">
                    <table class="table table-bordered" >
                        <thead>
                        <tr>
                            <th style="text-align: center; width:135px;">所属部位</th>
                            <th style="text-align: center; width:135px;">项目描述</th>
                            <th><input type="button" class="btn btn-primary" onclick="insert_row(this)" value="增加"></th>
                        </tr>
                        </thead>
                        <tbody id="tbl">
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
        <footer class="panel-footer text-right bg-light lter">
            <button type="submit" class="btn btn-success btn-s-xs">提交</button>
        </footer> </section>
</form>

<script type="text/javascript">
    var i = 0
    function insert_row(obj) {
        i++;
        R = tbl.insertRow(tbl.rows.length);
        C = R.insertCell(0);
        C.innerHTML = '<div class="input-group"><input type="text" class="form-control" name="ly_dev_part"id="ly_dev_part'+i+'">'
            + '<span class="input-group-btn">'
            + '<span class="glyphicon glyphicon-search"></span></button></span></div>';
        C = R.insertCell(1);
        C.innerHTML = '<div class="input-group"><input type="text" class="form-control" name="ly_dev_describe" id="ly_dev_describe"></div>';
        C = R.insertCell(2);
        C.innerHTML = '<input type="button" class="btn btn-danger" onclick ="deleteRow(this)" value ="删除">';
    }
    function deleteRow(obj) {
        var i = obj.parentNode.parentNode.rowIndex;
        if (i > 0) {
            tbl.deleteRow(i-1);
        }
    }
</script>
</body>
</html>